//
//  FLYNavigationController.m
//  ProjectDemo
//
//  Created by IOS3 on 2018/10/24.
//  Copyright © 2018 IOS3. All rights reserved.
//

#import "FLUNavigationController.h"

@interface FLUNavigationController () <UINavigationControllerDelegate>

@end

@implementation FLUNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.delegate = self;
    
//    UIButton *button = [[UIButton alloc] init];
//    [button setTitle:@"返回" forState:UIControlStateNormal];
//    [button setTitleColor:UIColor.darkTextColor forState:UIControlStateNormal];
//    [button setTitleColor:UIColor.darkTextColor forState:UIControlStateHighlighted];
////    button addTarget:<#(nullable id)#> action:<#(nonnull SEL)#> forControlEvents:<#(UIControlEvents)#>
//    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
    
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if (self.childViewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = true;
    }
    [super pushViewController:viewController animated:animated];
}


//- (BOOL)shouldAutorotate {
//    return [[self topViewController:self] shouldAutorotate];
//}
//- (UIViewController *)topViewController:(UIViewController *)controller {
//    while (controller.presentedViewController) {
//        controller = controller.presentedViewController;
//    }
//    if ([controller isKindOfClass:[UINavigationController class]]) {
//        UINavigationController *nav = (UINavigationController *)controller;
//        controller = nav.topViewController;
//        [self topViewController:controller];
//    }
//    if ([controller isKindOfClass:[UITabBarController class]]) {
//        UITabBarController *tab = (UITabBarController *)controller;
//        controller = tab.selectedViewController;
//        [self topViewController:controller];
//    }
//    return controller;
//}


@end
